<script type="text/javascript">
 var subject=new Array(4);
 var subject_id=new Array(4);
 subject[0]=new Array();
 subject[1]=new Array();
 subject[2]=new Array();
 subject_id[0]=new Array();
 subject_id[1]=new Array();
 subject_id[2]=new Array();

   <?php
    $ind_s=0;
    $ind_a=0;
    $ind_c=0;
	 foreach($code_subject as $row)
		{
		    if($row["group_id"]=="Science")
		     {?>
			    subject[0][<?php echo $ind_s ; ?>]= '<?php echo $row["subject_name"]; ?>';
			    subject_id[0][<?php echo $ind_s ; ?>]= '<?php echo $row["subject_id"]; ?>';
			     
		<?php $ind_s=$ind_s+1;
            }
	      }	?>
	      <?php
	      foreach($code_subject as $row)
			{
			    if($row["group_id"]=="Humanities")
			     {?>
				    subject[1][<?php echo $ind_a ; ?>]= '<?php echo $row["subject_name"]; ?>';
				    subject_id[1][<?php echo $ind_a ; ?>]= '<?php echo $row["subject_id"]; ?>';
				     
			<?php $ind_a=$ind_a+1;
	            }
		      }	?> 
		      <?php
		    	 foreach($code_subject as $row)
		    	  {
		    		  if($row["group_id"]=="Business Studies")
		    		     {?>
		    			    subject[2][<?php echo $ind_c ; ?>]= '<?php echo $row["subject_name"]; ?>';
		    			    subject_id[2][<?php echo $ind_c ; ?>]= '<?php echo $row["subject_id"]; ?>';
		    				     
		    <?php $ind_c=$ind_c+1;
		    	  }
		    }	?>    
	function com_subject_id()
	    {
		 var myOpt=document.getElementById("subject_id");
		 var group_id=document.getElementById("group_id").value;
		 myOpt.length=0;
		 var k=0;
		  if(group_id=="Science")
		  {
			  for(var i=0;i<subject[0].length;i++)
		        myOpt.options[k++] = new Option(subject[0][i],subject_id[0][i]);
		  }
		  if(group_id=="Humanities")
		  {
			  for(var i=0;i<subject[1].length;i++)
		        myOpt.options[k++] = new Option(subject[1][i],subject_id[1][i]);
		  }
		  if(group_id=="Business Studies")
		  {
			  for(var i=0;i<subject[2].length;i++)
		        myOpt.options[k++] = new Option(subject[2][i],subject_id[2][i]);
		  }
		}


	function insertStudents(student_id)
	{
		document.getElementById('area_student_id').value=student_id;
	}
	/////////////////////////////////////////////////////////////////////////////	    
</script>

		<ul class="breadcrumb"><span style="font-size:14px;font-weight:bold;">Update Subject Class Number</span> </ul>
		    
<div id="subj_total_att_html"  align="center">
<form id="subj_total_att_form">
<table style="text-align: left;width: 40%" align="center" border="0">
  <tr><td>Session </td>
				  <td>
				     <select name="academic_session" id="academic_session">
	               <?php
	                  $academic_session=$_SESSION['academic_session'];
	                  foreach($academic_session as $row)
	                  {
				       echo '<option value="'.$row["academic_session"].'">'.$row["academic_session"].'</option>';
	                  }
				    ?>
				   </select>
			     </td>
			  </tr>
  <tr>
    <td>
   Group Type
    </td>
    <td> 
         <select id="group_id" name="group_id" onchange="com_subject_id()">
           <option value="Science">Science</option>
           <option value="Humanities">Humanities</option>
           <option value="Business Studies">Business Studies</option>
           <option value="" selected="selected">Please Select</option>
         </select>
    </td>
  </tr>
  <tr>
    <td>
   Section
    </td>
    <td> 
         <select id="section" name="section" >
           <option value="A">A</option>
           <option value="B">B</option>
           <option value="C">C</option>
           <option value="D">D</option>
           <option value="AB">AB</option>
           <option value="CD">CD</option>
           <option value="" selected="selected">Please Select</option>
         </select>
    </td>
  </tr>
  <tr>
    <td>
     Subject Name
    </td>
    <td> 
         <select id="subject_id" name="subject_id">
           
         </select>
    </td>
    </tr>
      <tr><td>Exam Name</td>
				  <td>
				     <select id="exam_name" name="exam_name" onchange="attence_exam_change()">
				       <option value="" selected="selected">Please Select Exam Name</option>
				       <option value="first_term">First Term Test</option>
				       <option value="pro_test" >Promotion Test</option>
				       <option value="pre_test" >Pre-Test</option>
				       <option value="test_exam" >Test Examination</option>
				     </select>
			      </td>
			  </tr>
     <tr>
    <td>
     No of Classes
    </td>
    <td> 
         <input type="text" id="no_of_class" name="no_of_class" size="30"/>
    </td>
  </tr>
  <tr>
    <td colspan="2" align="center"> 
   
         <input type="submit" name="" id="" class="btn btn-primary" value="Update" >
    </td>
  </tr>
</table>
  
  </form>
</div>

	    <div onMouseUp="return false" class="translucent" onMouseMove="return false" onMouseDown="return false"
                                                                id="blockDim" onDblClick="return false" style="DISPLAY: none; Z-INDEX: 50000; LEFT: 0px; POSITION: absolute; TOP: 0px; BACKGROUND-COLOR: #FFFFFF;border: 1px solid black;text-align: center;"
                                                                onclick="return false" >
           <img src="<?php echo base_url(); ?>assets/img/ajax-loader5.gif" id="imagePosition">
           <div id="loading" style="font-size: 20px;font-weight: bold"></div>                                                             
         </div>
         
          <div style="text-align: center;">
		    <input type="button" onclick="show_all_attendence();" value="Show Attendence" >
		  </div>
         <div id="attendence_div">
         </div>
         